#!/bin/bash
############################################################################# ##
# Copyright (C) 2019-2024 ZKLX Tech, Inc.
############################################################################ ##
#
# -------------------------------------------------------------------------- --
#     AUTHOR                   : EExuke
#     FILE NAME                : postinst.sh
#     FILE DESCRIPTION         : 安装后执行的脚本
#     FIRST CREATION DATE      : 2024/07/30
# --------------------------------------------------------------------------
#     Version                  : 1.0
#     Last Change              : 2024/07/30
## ************************************************************************** ##

#-----------------------------------------------------------
#                CONTROL and COLOUR VARIABLES
#-----------------------------------------------------------
C_ED="\033[0m"    C_HL="\033[01m"   C_UL="\033[04m"
C_BL="\033[05m"   C_RV="\033[07m"   C_HD="\033[08m"
C_UP="\033[nA"    C_DW="\033[nB"    C_RI="\033[nC "
C_LE="\033[nD"    C_PS="\033[y;xH"  C_CL="\033[2J "
F_BL="\033[30m"   F_RD="\033[31m"   F_GR="\033[32m"
F_YL="\033[33m"   F_BU="\033[34m"   F_PU="\033[35m"
F_DG="\033[36m"   F_WT="\033[37m"   B_BL="\033[40m"
B_RE="\033[41m"   B_GR="\033[42m"   B_YL="\033[43m"
B_BU="\033[44m"   B_PR="\033[45m"   B_DG="\033[46m"
B_WT="\033[47m"

#-----------------------------------------------------------
#                  MAIN PROCESS
#-----------------------------------------------------------
echo -e "================================="
echo -e "hello, now is in post install run:"

# 关闭nvgetty服务
#echo -e "close nvgetty.service"
#sudo systemctl disable nvgetty.service

# 加载modules
#echo -e "load modules"
#sudo depmod
sudo systemctl daemon-reload

#echo -e "${F_YL}enable ftv_cv.service ${C_ED}"
#echo -e "${F_YL}enable ftv_sys.service ${C_ED}"
#echo -e "${F_YL}enable ctv_cv.service ${C_ED}"
#echo -e "${F_YL}enable ctv_sys.service ${C_ED}"
#echo -e "${F_YL}enable itv_cv.service ${C_ED}"
#echo -e "${F_YL}enable itv_sys.service ${C_ED}"

# 应用补丁脚本
#echo -e "apply /tmp/patch_root patchs"
#sudo cp -ar /tmp/patch_root/* /
#sync

# 开自启相关service
#echo -e "${F_YL}start CV services${C_ED}"
#sudo systemctl start ftv_cv
#sudo systemctl start ctv_cv
#sudo systemctl start itv_cv
#sudo systemctl start citv_cv
#sudo systemctl start fitv_cv

#echo -e "${F_YL}start SYS services${C_ED}"
#sudo systemctl start ftv_sys
#sudo systemctl start ctv_sys
#sudo systemctl start itv_sys
#sudo systemctl start citv_sys
#sudo systemctl start fitv_sys

echo -e "================================="

